﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace SmartText
{
    public class AppInfo : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public bool HasCommandLineArgs { get; set; }
        public string Template { get; set; }
        public string Param { get; set; }
        public string Output { get; set; }
        private string _outputText;
        public string OutputText
        {
            get
            {
                return _outputText;
            }
            set
            {
                _outputText = value;
                OnPropertyChanged(new PropertyChangedEventArgs("OutputText"));
            }
        }
        public Encoding TemplateEncoding { get; set; }
        public Encoding ParamEncoding { get; set; }
        public Encoding OutputEncoding { get; set; }
        public App.LangInfo LangInfo { get; set; }
        public bool OutputSuccess { get; set; }

        public AppInfo()
        {
            Template = Param = Output = OutputText = string.Empty;
            TemplateEncoding = Encoding.Default;
            ParamEncoding = Encoding.Default;
            OutputEncoding = Encoding.Default;
        }

        public void OnPropertyChanged(PropertyChangedEventArgs e)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, e);
            }
        }
    }
}

